#import <Foundation/Foundation.h>
@class MonitorDBModel;
@interface MonitorDBManager : NSObject
+ (MonitorDBManager *)shareInstance;

//初始化表
-(BOOL)createTable;

//-(BOOL)createRow:(RNDBModuleInfoDTO*)dto;
//-(BOOL)updateRow:(RNDBModuleInfoDTO*)dto;
//-(BOOL)updateSuccessByModel:(RNModuleInfoModel*)model;
//
//-(NSInteger)isModuleExist:(RNDBModuleInfoDTO*)dto;
//-(RNDBModuleInfoDTO*)selectLatestRow:(NSString*)name;
//-(RNDBModuleInfoDTO*)selectRow:(RNDBModuleInfoDTO*)dto;
// db无需经常关闭，除非你更换schema
- (NSArray<MonitorDBModel *> *)searchDataWithDomain:(NSString *)domain deleteData:(BOOL)deleteData;
- (NSArray<MonitorDBModel *> *)searchDataWithDomain:(NSString *)domain deleteData:(BOOL)deleteData count:(NSInteger)count;
- (int64_t)insertData:(NSString *)data;
/**
 * 删除所有数据
 */
- (BOOL)clearData;

/**
 * 删除特定条数的数据
 * @param fromIndex 索引起始位置
 * @param toIndex 索引结束位置
 */
- (BOOL)clearDataFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex;

-(void)closeDB;


@end
